home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 7176 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  3.3 KB

  1. Path: enea.se!not-for-mail
  2. From: olli@enea.se (Ola Liljedahl)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: Messages vs. Semaphores for external clocking
  5. Date: 11 Apr 1996 01:57:51 +0200
  6. Organization: Enea OSE Systems AB; "OSE - Design on a higher level"
  7. Message-ID: <4khhtv$52e@gordon.enea.se>
  8. References: <4ju349$r1e@sparky.navsea.navy.mil> <4jvrqs$hk0@btmpjg.god.bel.alcatel.be> <heinz.17rm@hwg.muc.de> <4kfmes$lle@btmpjg.god.bel.alcatel.be>
  9. NNTP-Posting-Host: gordon.enea.se
  10. Keywords: interprocess communication, synchronization, real time system
  11.  
  12. Jaco Barnhoorn wrote:
  13. > In article <heinz.17rm@hwg.muc.de>, heinz@hwg.muc.de (Heinz Wrobel) writes:
  14. > >barnhoorn@nlev00 wrote:
  15. > >>Use global data, which your subtask fills with the timer-values,
  16. > >>and the parent process reads. Disable() and Enable() multitasking
  17.                                   ^^^^^^^^^^^^^^^^^^^^^^
  18.                                   disables and enables interrupts!!!
  19. > >>when performing such a critical action (reading or writing from the
  20. > >>global data). No message port or semaphore needed.
  21. > >
  22. > >Obviously this is the dumb c0d3r non multitasking solution, i.e.
  23. > >plain stupid.
  24. > >
  25. > ..not so obviously. When you have two tasks, and one of them is
  26. > collecting data from some source, and the other one needs this data
  27. > with regular intervals, I don't see a more easier way to do this
  28.                                              ^^^^^^
  29.                                              this is a lame excuse
  30. > then by using global data and disable/enable multitasking. It is
  31.                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  32.                                 Forbid() and Permit()
  33. > a very multitasking-friendly solution, and there is nothing
  34. > 'dumb c0d3r' (whatever that may be) about it.
  35. > -- 
  36. > ---------------------------------------------------------------------------
  37. > Jaco Barnhoorn               barnie@xs4all.nl
  38. > Software Test Engineer       barnhoorn%nlev00@btmv56.se.bel.alcatel.be
  39. > Alcatel Telecom Systems
  40.   ^^^^^^^^^^^^^^^
  41.   Telecom IS real time!!! (or used to be)
  42. > Rijswijk, The Netherlands
  43.  
  44. I am new to this thread, but your talk about disabling interrupts because
  45. you are referencing a global data area makes me feel sick. Have your ever
  46. heard of real time systems??? You DON'T disable interrupts for an 
  47. (indeterminate) time! You don't know anything about what else goes on in
  48. the system and might need the short deterministic interrupt latency.
  49. Disabling the dispatcher (Forbid()) isn't that dangerous but still not
  50. recommended, it will prevent the OS from scheduling processes that
  51. nominally have higher priority.
  52.  
  53. If you are programming an embedded system where you have total control
  54. over all software and know all components timing needs you may disable/
  55. enable interrupts and/or multitasking. It is up to you to guarantee that
  56. the system works according to specifications. 
  57.  
  58. But in a system like the Amiga where the user may run several different
  59. applications at the same time you should not tamper with the system's
  60. scheduling. Use a global data area protected by a semaphore/mutex or
  61. send messages if you want more asynchronous behaviour.
  62.  
  63. Check out http://www.enea.se/ose for information about OSE, the real time
  64. operating system from Enea OSE Systems.
  65.  
  66. Regards,
  67.  
  68.     Ola Liljedahl
  69.     olli@enea.se
  70.     "OSE - Design on a higher level"
  71.